#include <stdio.h>

void swap(int*, int*);
void inputString(char*);
int strLen(char*);

int main() {
	int a = 10, b = 20;

	/*swap(&a, &b);
	printf("a: %d, b: %d\n", a, b);*/

	//char str[10];

	/*for (int i = 0; i < 10; i++)
	{
		inputString(&str[i]);
	}
	printf("str: %s\n", str);*/

	char str[] = "hello, world!";

	printf("str length: %d\n", strLen(str));
	printf("str length: %d\n", strLen(&str[0]));
	
	return 0;
}

void swap(int *a, int *b) {
	int tmp;

	tmp = *a;
	*a = *b;
	*b = tmp;
}

void inputString(char* s) {
	int c = getchar();

	*s = char(c);
}

int strLen(char *s) {
	int n = 0;

	while (*(s++) != '\0')
	{
		n++;
	}
	return n;
}